package org.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 设备信息
 *
 * @author Fz
 * @since 1.0.0 2024-02-26
 */
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("col_device_data_compute")
public class ColDeviceDataCompute {

    @IsKey
    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    @Column(name = "device_id", comment = "设备id", type = MySqlTypeConstant.BIGINT)
    private Long deviceId;

    @Column(name = "sett0", comment = "日累计蒸散量ET值", type = MySqlTypeConstant.FLOAT, decimalLength = 3)
    private Float sett0;

    @Column(name = "et0", comment = "参考蒸散量", type = MySqlTypeConstant.FLOAT, decimalLength = 3)
    private Float et0;

    @Column(name = "qh", comment = "每小时的液流量", type = MySqlTypeConstant.FLOAT, decimalLength = 3)
    private Float qh;

    @Column(name = "qd", comment = "每天的液流量", type = MySqlTypeConstant.FLOAT, decimalLength = 3)
    private Float qd;

    @Column(name = "q0", comment = "每天的平均液流量", type = MySqlTypeConstant.FLOAT, decimalLength = 3)
    private Float q0;

    @Column(name = "creator", comment = "创建者")
    private Long creator;

    @TableField(fill = FieldFill.INSERT)
    @Column(name = "create_date", comment = "创建时间", type = MySqlTypeConstant.DATETIME)
    private Date createDate;

    @Column(name = "updater", comment = "修改者")
    private Long updater;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "update_date", comment = "更新时间", type = MySqlTypeConstant.DATETIME)
    private Date updateDate;

    @Column(name = "del_flag", comment = "删除标志 0 正常 1 已删除", length = 2, type = MySqlTypeConstant.TINYINT)
    private Integer delFlag;

    @Column(name = "deleter", comment = "删除者")
    private Long deleter;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @Column(name = "delete_date", type = MySqlTypeConstant.DATETIME, comment = "删除时间")
    private Date deleteDate;

    @Column(name = "set_name", type = MySqlTypeConstant.VARCHAR, comment = "显示名称", length = 200)
    private String setName;

    @Column(name = "set_value", type = MySqlTypeConstant.VARCHAR, comment = "计算值", length = 200)
    private String setValue;

    @Column(name = "data_id", comment = "数据id", type = MySqlTypeConstant.BIGINT)
    private Long dataId;

}